<!DOCTYPE html>
<html>
	<head>
		<title>Suggest for richselect and combo</title>
		<link rel="stylesheet" href="../../codebase/webix.css" type="text/css" charset="utf-8">
		<script src="../../codebase/webix.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="../15_datatable/common/samples.css">
	</head>
	<body>
		
		<div id="testC" style="width:300px; height:15px;"></div>
	
	<script type="text/javascript" charset="utf-8">

	webix.ready(function(){

		var fruit = [
			{id:1, value:"Apple"},
            {id:2, value:"Banana"},
            {id:3, value:"Kiwi"},
            {id:4, value:"Melon"}
		];

		webix.ui({
			container:"testC",
			view:"toolbar", 
			elements:[
				{view:"richselect", id:"richselect1",
    				suggest:{
        				data:fruit,
        				ready: function(){
            				$$("richselect1").setValue(this.getFirstId()); //defines the initially visible option
        				}
    				}
				},
				{view:"combo",
					suggest:{
						data:fruit
                	},
                value:4		
				}
			]
    			
		});
	});

		
		</script>
	</body>
</html>